#include <modules\graphics\static_entity.h>

namespace DelGE
{
	namespace Modules
	{
		namespace Graphics
		{
			StaticEntity::StaticEntity()
			{
				this->SetScale(1, 1, 1);
				this->SetPosition(0, 0, 0);
				this->SetRotation(0, 0, 0);
			}

			StaticEntity::StaticEntity(StaticEntity *pEntity)
			{
				this->SetScale(pEntity->GetScale());
				this->SetRotation(pEntity->GetRotation());
				this->SetPosition(pEntity->GetPosition());

				for (int iModelIndex = 0; iModelIndex < pEntity->GetModelCount(); iModelIndex ++)
					this->vModels.push_back(pEntity->GetModel(iModelIndex));					
			}

			StaticEntity::~StaticEntity()
			{
			}

			StaticEntity *StaticEntity::ShallowCopy(StaticEntity *pEntity)
			{
				return new StaticEntity(pEntity);
			}

			void StaticEntity::AddModel(Model* pModel)
			{
				if (pModel == NULL) pModel = new Model();

				Entity::AddModel(pModel);
			}

			Model* StaticEntity::GetModel(int iIndex)
			{
				return Entity::GetModel(iIndex);
			}

			int StaticEntity::GetModelCount()
			{
				return Entity::GetModelCount();
			}

			Model* StaticEntity::GetRenderModel(int iModelIndex)
			{
				if (iModelIndex < 0 || iModelIndex >= this->GetModelCount()) return NULL;

				return this->vModels[iModelIndex];
			}

			void StaticEntity::Destroy()
			{
				Entity::Destroy();
			}
		}
	}
}